# try..else 如未捕获到异常，那么就执行else中的事情
help_str = """
1 触发异常
2 不触发异常
"""
try:
    cmd = input(help_str)
    if cmd == "1":
        raise Exception("error")
    elif cmd == "2":
        print("no error 不触发异常")
except Exception as e:
    print("+++ except", e)
else:
    print("--- else")
